package com.relax.config;


import com.relax.bean.Person;

import com.relax.listener.MylisteneListener;
import org.springframework.context.annotation.*;

@Configuration//告诉spring这是一个配置类
@ComponentScan(value="com.relax.beanfacotorypostprocess")
//@ComponentScan(value = "cn.ali", useDefaultFilters = false, includeFilters =
//        {@ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {Controller.class}),
//                @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = BookService.class)})
//自定义过滤规则
//@ComponentScan(value = "com.relax", useDefaultFilters = false, includeFilters = {@ComponentScan.Filter(type = FilterType.CUSTOM, classes = {MyFilter.class})})
public class MainConfig {
    @Bean
    public Person person() {
        return new Person("lisi", 23);
    }

    @Bean

    public Person person1() {
        return new Person("lisi11", 231);
    }

    @Bean
    @DependsOn("person")
    public MylisteneListener mylisteneListener(){
        return new MylisteneListener();
    }
}
